/* 响应式样式文件 - 适配PC端1920+和笔记本屏幕 */

/* 基础断点定义 */
:root {
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  --breakpoint-3xl: 1920px;
  --breakpoint-4xl: 2560px;
}

/* 移动端优先的基础样式 */
.container {
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  margin-left: auto;
  margin-right: auto;
}

/* 小屏幕 (640px+) */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  .grid {
    gap: 1rem;
  }
  
  .tool-card {
    padding: 1.25rem;
  }
  
  .navbar-content {
    padding: 1rem 1.5rem;
  }
}

/* 平板端 (768px+) */
@media (min-width: 768px) {
  .container {
    max-width: 768px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
  
  /* 导航栏 */
  .navbar-content {
    padding: 1.25rem 2rem;
  }
  
  .navbar-brand {
    font-size: 1.75rem;
  }
  
  .navbar-nav {
    gap: 1.5rem;
  }
  
  /* 布局 */
  .main-layout {
    display: flex;
    gap: 2rem;
  }
  
  .sidebar {
    width: 240px;
    flex-shrink: 0;
  }
  
  .main-content {
    flex: 1;
    padding: 2rem;
  }
  
  /* 工具卡片 */
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .tool-card {
    padding: 1.5rem;
  }
  
  .tool-card-icon {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.5rem;
  }
  
  .tool-card-title {
    font-size: 1.25rem;
  }
  
  /* 表单 */
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .form-input {
    padding: 0.875rem 1rem;
  }
  
  /* 模态框 */
  .modal-content {
    max-width: 600px;
  }
}

/* 笔记本端 (1024px+) */
@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
  
  /* 导航栏 */
  .navbar-content {
    padding: 1.5rem 2.5rem;
  }
  
  .navbar-brand {
    font-size: 2rem;
  }
  
  .navbar-nav {
    gap: 2rem;
  }
  
  .navbar-nav a {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }
  
  /* 侧边栏 */
  .sidebar {
    width: 280px;
    padding: 2.5rem 2rem;
  }
  
  .sidebar-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .sidebar-menu a {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
  
  .sidebar-menu i {
    width: 1.5rem;
    margin-right: 1rem;
  }
  
  /* 主内容 */
  .main-content {
    padding: 2.5rem;
  }
  
  /* 工具网格 */
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
  
  .tool-card {
    padding: 2rem;
  }
  
  .tool-card-icon {
    width: 4rem;
    height: 4rem;
    font-size: 1.75rem;
  }
  
  .tool-card-title {
    font-size: 1.375rem;
  }
  
  .tool-card-description {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  /* 按钮 */
  .btn {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
  }
  
  .btn-lg {
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
  }
  
  /* 表单 */
  .form-input {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
  
  .form-label {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  /* 统计卡片 */
  .stat-card {
    padding: 2rem;
  }
  
  .stat-icon {
    width: 4rem;
    height: 4rem;
    font-size: 1.5rem;
  }
  
  .stat-content h3 {
    font-size: 2rem;
  }
  
  .stat-content p {
    font-size: 1rem;
  }
}

/* 桌面端 (1280px+) */
@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
    padding-left: 3rem;
    padding-right: 3rem;
  }
  
  /* 工具网格 */
  .tools-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
  }
  
  /* 侧边栏 */
  .sidebar {
    width: 320px;
    padding: 3rem 2.5rem;
  }
  
  /* 主内容 */
  .main-content {
    padding: 3rem;
  }
  
  /* 导航栏 */
  .navbar-content {
    padding: 2rem 3rem;
  }
}

/* 大屏幕 (1536px+) */
@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
  
  .tools-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .sidebar {
    width: 360px;
  }
}

/* 超大屏幕 PC端 (1920px+) */
@media (min-width: 1920px) {
  .container {
    max-width: 1800px;
    padding-left: 4rem;
    padding-right: 4rem;
  }
  
  /* 导航栏 */
  .navbar-content {
    padding: 2.5rem 4rem;
  }
  
  .navbar-brand {
    font-size: 2.25rem;
  }
  
  .navbar-nav {
    gap: 3rem;
  }
  
  .navbar-nav a {
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
  }
  
  /* 侧边栏 */
  .sidebar {
    width: 400px;
    padding: 4rem 3rem;
  }
  
  .sidebar-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .sidebar-menu a {
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
  }
  
  .sidebar-menu i {
    width: 2rem;
    margin-right: 1.25rem;
    font-size: 1.125rem;
  }
  
  /* 主内容 */
  .main-content {
    padding: 4rem;
  }
  
  /* 工具网格 */
  .tools-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 3rem;
  }
  
  .tool-card {
    padding: 2.5rem;
  }
  
  .tool-card-icon {
    width: 5rem;
    height: 5rem;
    font-size: 2rem;
    margin-right: 1.5rem;
  }
  
  .tool-card-title {
    font-size: 1.5rem;
  }
  
  .tool-card-description {
    font-size: 1.125rem;
    line-height: 1.7;
  }
  
  .tool-card-footer {
    padding-top: 1.5rem;
  }
  
  .tool-card-stats {
    gap: 1.5rem;
    font-size: 1rem;
  }
  
  /* 按钮 */
  .btn {
    padding: 1rem 2rem;
    font-size: 1.125rem;
  }
  
  .btn-sm {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  
  .btn-lg {
    padding: 1.5rem 3rem;
    font-size: 1.25rem;
  }
  
  /* 表单 */
  .form-input {
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
  }
  
  .form-label {
    font-size: 1.125rem;
    margin-bottom: 1rem;
  }
  
  .form-group {
    margin-bottom: 2rem;
  }
  
  /* 统计卡片 */
  .stat-card {
    padding: 2.5rem;
  }
  
  .stat-icon {
    width: 5rem;
    height: 5rem;
    font-size: 2rem;
    margin-right: 1.5rem;
  }
  
  .stat-content h3 {
    font-size: 2.5rem;
  }
  
  .stat-content p {
    font-size: 1.125rem;
  }
  
  /* 模态框 */
  .modal-content {
    max-width: 800px;
  }
  
  .modal-header {
    padding: 2rem;
  }
  
  .modal-title {
    font-size: 1.5rem;
  }
  
  .modal-body {
    padding: 2rem;
  }
  
  .modal-footer {
    padding: 2rem;
    gap: 1.5rem;
  }
  
  /* 上传区域 */
  .upload-area {
    padding: 4rem 3rem;
  }
  
  /* 个人中心 */
  .profile-sidebar {
    padding: 3rem;
  }
  
  .profile-avatar {
    width: 120px;
    height: 120px;
    font-size: 3rem;
    margin-bottom: 2rem;
  }
  
  .profile-nav {
    margin-top: 3rem;
  }
  
  .profile-nav a {
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
  }
  
  .profile-nav i {
    width: 2rem;
    margin-right: 1.25rem;
    font-size: 1.125rem;
  }
}

/* 4K屏幕 (2560px+) */
@media (min-width: 2560px) {
  .container {
    max-width: 2400px;
    padding-left: 5rem;
    padding-right: 5rem;
  }
  
  .tools-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 4rem;
  }
  
  .navbar-content {
    padding: 3rem 5rem;
  }
  
  .navbar-brand {
    font-size: 2.5rem;
  }
  
  .sidebar {
    width: 480px;
    padding: 5rem 4rem;
  }
  
  .main-content {
    padding: 5rem;
  }
  
  .tool-card {
    padding: 3rem;
  }
  
  .tool-card-icon {
    width: 6rem;
    height: 6rem;
    font-size: 2.5rem;
  }
  
  .tool-card-title {
    font-size: 1.75rem;
  }
  
  .tool-card-description {
    font-size: 1.25rem;
  }
}

/* 高度适配 */
@media (max-height: 600px) {
  .sidebar {
    height: calc(100vh - 60px);
  }
  
  .navbar-content {
    padding: 0.75rem 1rem;
  }
  
  .main-content {
    padding: 1.5rem;
  }
}

@media (min-height: 800px) {
  .sidebar {
    height: calc(100vh - 80px);
  }
}

@media (min-height: 1080px) {
  .sidebar {
    height: calc(100vh - 100px);
  }
  
  .main-content {
    min-height: calc(100vh - 100px);
  }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 600px) {
  .navbar-content {
    padding: 0.5rem 1rem;
  }
  
  .sidebar {
    padding: 1rem;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .tool-card {
    padding: 1rem;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .tool-card:hover {
    transform: none;
  }
  
  .btn {
    min-height: 44px;
  }
  
  .form-input {
    min-height: 44px;
  }
  
  .sidebar-menu a {
    min-height: 44px;
  }
  
  .navbar-nav a {
    min-height: 44px;
  }
}

/* 高分辨率显示器优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .tool-card-icon {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  .navbar-brand {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* 减少动画的用户偏好 */
@media (prefers-reduced-motion: reduce) {
  .tool-card {
    transition: none;
  }
  
  .btn {
    transition: none;
  }
  
  .sidebar-menu a {
    transition: none;
  }
  
  .fade-in {
    animation: none;
  }
  
  .slide-up {
    animation: none;
  }
}

/* 对比度偏好 */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-secondary: #333333;
  }
  
  .tool-card {
    border-width: 2px;
  }
  
  .btn {
    border-width: 2px;
    border-style: solid;
  }
  
  .btn-primary {
    border-color: var(--primary-color);
  }
  
  .btn-secondary {
    border-color: var(--text-secondary);
  }
}

/* 深色模式响应式调整 */
@media (prefers-color-scheme: dark) {
  @media (min-width: 1920px) {
    .tool-card {
      box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    }
    
    .navbar {
      box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    }
    
    .modal-content {
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
  }
}

/* 打印样式响应式 */
@media print {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
  
  .tool-card {
    padding: 1rem !important;
    break-inside: avoid;
  }
  
  .container {
    max-width: none !important;
    padding: 0 !important;
  }
}

/* 容器查询支持 (实验性) */
@supports (container-type: inline-size) {
  .tools-container {
    container-type: inline-size;
  }
  
  @container (min-width: 400px) {
    .tool-card {
      padding: 1.5rem;
    }
  }
  
  @container (min-width: 600px) {
    .tool-card {
      padding: 2rem;
    }
  }
  
  @container (min-width: 800px) {
    .tool-card {
      padding: 2.5rem;
    }
  }
}

/* 网格自适应 */
.tools-grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .tools-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .tools-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
  }
}

@media (min-width: 1920px) {
  .tools-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
  }
}

/* 弹性布局辅助类 */
.flex-responsive {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .flex-responsive {
    flex-direction: row;
    gap: 2rem;
  }
}

@media (min-width: 1920px) {
  .flex-responsive {
    gap: 3rem;
  }
}

/* 文字大小响应式 */
.text-responsive {
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .text-responsive {
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  .text-responsive {
    font-size: 1.125rem;
  }
}

@media (min-width: 1920px) {
  .text-responsive {
    font-size: 1.25rem;
  }
}

/* 间距响应式 */
.spacing-responsive {
  padding: 1rem;
  margin: 0.5rem;
}

@media (min-width: 768px) {
  .spacing-responsive {
    padding: 1.5rem;
    margin: 1rem;
  }
}

@media (min-width: 1024px) {
  .spacing-responsive {
    padding: 2rem;
    margin: 1.5rem;
  }
}

@media (min-width: 1920px) {
  .spacing-responsive {
    padding: 3rem;
    margin: 2rem;
  }
}